﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OpenCommunityProfilesAdmin.ascx.cs"
    Inherits="Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenCommunity.OpenCommunityProfilesAdmin" %>
<owc:OwGrid ID="OpenCommunityProfilesAdminGrid" runat="server" AutoGenerateColumns="False"
    CellSpacing="0" DataSourceID="OpenCommunityProfilesOds" SkinID="OwGridAdmin"
    OwMessageDisplayType="InPlace" GridLines="None" OwEnableMessageDisplay="True">
    <MasterTableView DataSourceID="OpenCommunityProfilesOds" DataKeyNames="OpenCommunityProfileID">
        <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="<%$OwR:AddNewRecordText %>"
            RefreshText="<%$ OwR:RefreshText %>"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <owct:GridBoundColumn DataField="OpenCommunityProfileID" DataType="System.Int64"
                FilterControlAltText="Filter OpenCommunityProfileID column" HeaderText="<%$ OwR:Code %>"
                SortExpression="OpenCommunityProfileID" UniqueName="OpenCommunityProfileID">
            </owct:GridBoundColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$OwR:Community %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <%#OwCommunitiesBLL.OwGetEntity((long?)Eval("CommunityID")).AccountName%>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$OwR:OpenCommunityProfileDetail %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <%#OwOpenCommunityProfileDetailsBLL.OwGetEntity((long?)Eval("DefaultOpenCommunityProfileDetailID")).Name%>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$OwR:IsDeleted %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <div align="center">
                        <owc:OwCheckBox ID="IsDeletedCb" runat="server" Checked='<%#Eval("IsDeleted")%>'
                            AutoPostBack="true" Text='<%#Eval("OpenCommunityProfileID")%>' CssClass="HiddenText"
                            OnCheckedChanged="IsDeletedCb_CheckedChanged" />
                    </div>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$OwR:Modify %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <div align="center">
                        <asp:ImageButton CausesValidation="true" ID="EditButton1" CommandName="Edit" runat="server"
                            SkinID="OwConfirmButton" ImageUrl="/App_Themes/OpenWeb/OwImages/vi-VN/CommandNameIcons/edit.gif" />
                    </div>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$OwR:Delete %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <div align="center">
                        <asp:ImageButton CausesValidation="true" OnClientClick='if(!confirm("Are you sure to  Delete?")) return false'
                            ID="EditDeleteButton1" CommandName="Delete" runat="server" SkinID="OwConfirmButton"
                            ImageUrl="/App_Themes/OpenWeb/OwImages/vi-VN/CommandNameIcons/delete.gif" />
                    </div>
                </ItemTemplate>
            </owct:GridTemplateColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
            <FormTemplate>
                <fieldset>
                    <legend>
                        <owc:OwR runat="server" OwText="InfoLabel" />
                    </legend>
                    <table>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="Community" />
                            </td>
                            <td>
                                <owc:OwObjectDataSource ID="CommunityOds" runat="server" DataObjectTypeName="Micronet.OpenWeb.Entity.OwCommunitiesEntity"
                                    DeleteMethod="OwDelete" InsertMethod="OwInsert" OldValuesParameterFormatString="original_{0}"
                                    SelectMethod="OwGetByDynamic" TypeName="Micronet.OpenWeb.Com.BLL.OwCommunitiesBLL"
                                    UpdateMethod="OwUpdate">
                                    <SelectParameters>
                                        <asp:Parameter Name="parentID" Type="Int64" />
                                        <asp:Parameter Name="isHomeDisplay" Type="Boolean" />
                                        <asp:Parameter Name="isHot" Type="Boolean" />
                                        <asp:Parameter Name="enableBegin" Type="DateTime" />
                                        <asp:Parameter Name="enableEnd" Type="DateTime" />
                                        <asp:Parameter Name="homeDisplayBegin" Type="DateTime" />
                                        <asp:Parameter Name="homeDisplayEnd" Type="DateTime" />
                                        <asp:Parameter Name="hotDisplayBegin" Type="DateTime" />
                                        <asp:Parameter Name="hotDisplayEnd" Type="DateTime" />
                                        <asp:Parameter DbType="Guid" Name="userID" />
                                        <asp:Parameter Name="isApproved" Type="Boolean" />
                                        <asp:Parameter DefaultValue="false" Name="isDeleted" Type="Boolean" />
                                        <asp:Parameter DbType="Guid" Name="creatingUser" />
                                        <asp:Parameter DbType="Guid" Name="editingUser" />
                                        <asp:Parameter DbType="Guid" Name="deletingUser" />
                                        <asp:Parameter Name="languageCode" Type="String" />
                                        <asp:Parameter Name="isEnabled" Type="Boolean" />
                                        <asp:Parameter Name="communityStatusID" Type="Int64" />
                                        <asp:Parameter Name="communityTypeID" Type="Int64" />
                                        <asp:Parameter Name="sortClause" Type="String" />
                                        <asp:Parameter Name="sortDirection" Type="String" />
                                        <asp:Parameter Name="startRowIndex" Type="Int32" />
                                        <asp:Parameter Name="maximumRows" Type="Int32" />
                                    </SelectParameters>
                                </owc:OwObjectDataSource>
                                <owc:OwComboBox ID="CommunityCbb" runat="server" DataSourceID="CommunityOds" SkinID="OwComboBox"
                                    EmptyMessage="<%$OwR:CommunitySelect %>" SelectedValue='<%# Bind("CommunityID") %>'
                                    DataTextField="AccountName" DataValueField="CommunityID">
                                </owc:OwComboBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="<%$ OwR:CommunitySelect %>"
                                    Text="*" ControlToValidate="CommunityCbb" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR runat="server" OwText="CommunityProfileDetail" />
                            </td>
                            <td>
                                <owc:OwObjectDataSource ID="CommunityProfileDetailOds" runat="server" DataObjectTypeName="Micronet.OpenWeb.Entity.OwOpenCommunityProfileDetailsEntity"
                                    DeleteMethod="OwDelete" InsertMethod="OwInsert" OldValuesParameterFormatString="original_{0}"
                                    SelectMethod="OwGetByDynamic" TypeName="Micronet.OpenWeb.Com.BLL.OwOpenCommunityProfileDetailsBLL"
                                    UpdateMethod="OwUpdate">
                                    <SelectParameters>
                                        <asp:Parameter Name="isHomeDisplay" Type="Boolean" />
                                        <asp:Parameter Name="isHot" Type="Boolean" />
                                        <asp:Parameter Name="enableBegin" Type="DateTime" />
                                        <asp:Parameter Name="enableEnd" Type="DateTime" />
                                        <asp:Parameter Name="homeDisplayBegin" Type="DateTime" />
                                        <asp:Parameter Name="homeDisplayEnd" Type="DateTime" />
                                        <asp:Parameter Name="hotDisplayBegin" Type="DateTime" />
                                        <asp:Parameter Name="hotDisplayEnd" Type="DateTime" />
                                        <asp:Parameter Name="isApproved" Type="Boolean" />
                                        <asp:Parameter DefaultValue="false" Name="isDeleted" Type="Boolean" />
                                        <asp:Parameter DbType="Guid" Name="creatingUser" />
                                        <asp:Parameter DbType="Guid" Name="editingUser" />
                                        <asp:Parameter DbType="Guid" Name="deletingUser" />
                                        <asp:Parameter Name="continentID" Type="Int64" />
                                        <asp:Parameter Name="countryID" Type="Int64" />
                                        <asp:Parameter Name="provinceID" Type="Int64" />
                                        <asp:Parameter Name="districtID" Type="Int64" />
                                        <asp:Parameter Name="wardID" Type="Int64" />
                                        <asp:Parameter Name="languageCode" Type="String" />
                                        <asp:Parameter Name="isEnabled" Type="Boolean" />
                                        <asp:Parameter Name="openCommunityProfileID" Type="Int64" />
                                        <asp:Parameter Name="sortClause" Type="String" />
                                        <asp:Parameter Name="sortDirection" Type="String" />
                                        <asp:Parameter Name="startRowIndex" Type="Int32" />
                                        <asp:Parameter Name="maximumRows" Type="Int32" />
                                    </SelectParameters>
                                </owc:OwObjectDataSource>
                                <owc:OwComboBox ID="CommunityProfileDetailCbb" runat="server" DataSourceID="CommunityProfileDetailOds"
                                    SkinID="OwComboBox" EmptyMessage="<%$OwR:CommunityProfileDetailSelect %>" SelectedValue='<%# Bind("DefaultOpenCommunityProfileDetailID") %>'
                                    DataTextField="Name" DataValueField="OpenCommunityProfileDetailID">
                                   
                                </owc:OwComboBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="<%$ OwR:CommunityProfileDetailSelect %>" Text="*" ControlToValidate="CommunityProfileDetailCbb" Display="Dynamic" />
                                
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <owc:OwButton ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    SkinID="OwButtonAdmin" runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                </owc:OwButton>
                                <owc:OwButton ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                    SkinID="OwButtonAdmin" CommandName="Cancel">
                                </owc:OwButton>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </HeaderContextMenu>
</owc:OwGrid>
<owc:OwObjectDataSource ID="OpenCommunityProfilesOds" runat="server" DataObjectTypeName="Micronet.OpenWeb.Entity.OwOpenCommunityProfilesEntity"
    DeleteMethod="OwDelete" InsertMethod="OwInsert" OldValuesParameterFormatString="original_{0}"
    SelectMethod="OwGetByDynamic" TypeName="Micronet.OpenWeb.Com.BLL.OwOpenCommunityProfilesBLL"
    SelectCountMethod="OwGetByDynamicCount" EnablePaging="True" UpdateMethod="OwUpdate">
    <SelectParameters>
        <asp:Parameter Name="isDeleted" Type="Boolean" />
        <asp:Parameter Name="communityID" Type="Int64" />
        <asp:Parameter Name="defaultOpenCommunityProfileDetailID" Type="Int64" />
        <asp:Parameter Name="sortClause" Type="String" />
        <asp:Parameter Name="sortDirection" Type="String" />
        <asp:Parameter Name="startRowIndex" Type="Int32" />
        <asp:Parameter Name="maximumRows" Type="Int32" />
    </SelectParameters>
</owc:OwObjectDataSource>
